Get new issues of The GitHub Insider in your inbox. Sign up now →
You’ll use these every day. ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ 
GitHub

Git is the most widely used version control system (VCS) in the world. Once you’ve installed it and gone through our beginner’s guide to version control, you may be wondering, well, what now?

And that’s what we’re here to talk about today: the Git commands every developer needs to know. These commands will be the backbone of your daily Git workflow. We’ll explore how to configure Git, start a repo, check your status, save progress, and collaborate with others.

Let's go!

Git config 👋

The git config command allows you to set Git configuration values that can help you create a customized Git workflow. For example, to set your email and username, type:

git config --global user.name "username"
git config --global user.email "youremail@email.com"

These two settings allow Git to associate your work with your username and email, so you can get credit for the work that you do.

💡 Pro tip: You can also run git config --list to double-check what’s been set.

Need help fine-tuning Git setup or integrating with GitHub? Here’s our walkthrough.

Git init ▶️

You can use the git init command to initialize a new Git repository. When you run the git init command in an ordinary folder, it allows you to transform that folder into a trackable Git repository where you can use Git commands.

git init

This creates a hidden .git directory where all the history lives.

💡 Pro tip: If you ever clone a repo, you don’t need to run git init — cloning already sets it up.

Now that your repo is set up, let’s check what’s going on inside it. 👇

Git status ⏰

To check the current state of your repository, type git status. It shows you which files have been added, deleted, or modified in your working directory.

git status

Pro tip: To add files to your staging area, you can use the git add command.

💡 Extra: Run git status -s (short status) for a cleaner, more compact view, great when you’re juggling lots of files.

Once you’ve reviewed your changes, the next step is saving them permanently. 👇

Git commit ✔️

To “commit” a change means to store a version of your project in Git’s history. If you make changes to a file, you can add it to the staging area with git add. Once your changes are staged, you can save them to the project history by running:

git commit -m "your commit message here"

💡 Pro tip: Use git log --oneline after committing to see your history in a quick, scannable way.

Great, you’ve made your first checkpoint. But what if you want to collaborate on existing projects? 👇

Git clone 👯

When you work on a team that uses Git for collaboration, you may be asked to use Git to make a local copy of a project folder to make changes. The command you’ll use for this is git clone. Say, for example, you have a remote repository on GitHub:

  1. Click on the green Code button.
  2. Select HTTPS.
  3. Copy the URL.
  4. Open your terminal and type:

git clone <url>

Paste the URL link in your terminal after the clone command, and hit the enter/return key. Done!

💡 Pro tip: Run git remote -v inside the cloned repo to see where it’s pulling from and pushing to.

There you have it: five essential Git commands to kickstart your version control journey! Ready to become a Git pro? Dive in deeper with our official, step-by-step docs guide:

Explore our Git docs guide now


✨ This newsletter was produced by Gwen Davis. ✨

More to explore 🌎



Discover the top Git commands 🤖

Take your Git skills to the next level with this guide to the most essential Git commands.

Watch now



GitHub Universe: Big ideas. Bigger builds. 💡

Explore the agenda and save $400 on your IRL pass — now extended to September 17.

Get pass now



Subscribe to our LinkedIn newsletter 🚀

Do your best work on GitHub. Subscribe to our LinkedIn newsletter, Branching Out_.

Sign up now




GitHub

The world’s leading AI-powered developer platform.